﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Maticsoft.Common
{
    public class DigitHelper
    {
        public static decimal GetDecimal(object obj)
        {
            decimal res = 0;
            if (obj != null && obj != DBNull.Value)
            {
                decimal.TryParse(obj.ToString(), out res);
            }

            return res;
        }

        public static int GetInt32(object obj)
        {
            int res = 0;
            if (obj != null && obj != DBNull.Value)
            {
                int.TryParse(obj.ToString(), out res);
            }

            return res;
        }
    }
}
